#ifndef _ANIMAL_HPP_
#define _ANIMAL_HPP_

#include <cstdlib>

#include "Organism.hpp"
#include "Forest.hpp"

/** 
 * Class Animal is a public member of the Class Organism.
 *
 * This class describes the functions that animals are capable of.
 * This class thinks animals mostly either eat, reproduce, or die.
 */
class Animal : public Organism {

private :
  /**
   * a vector of possible foods an animal might want to eat.
   */
  std::vector<std::string> food;

  /**
   * All animals are capable of eating.
   */
  void eatSomething(Forest& forest, int nfood) const;
  
public :
  /** 
   * A Copy Constructor for the Animal Class
   *
   * This takes a reference to a current instance of the animal
   * class and makes a new identical one.
   *
   * @param animal an instance of the Animal class to copy 
   */
  Animal(const Animal& animal) :
    Organism(animal), food(animal.food)
  {

  }

  /**
   * A full Constructor for the Animal Class
   *
   * This constructor requires that you define all the 
   * characteristics that define a unique animal.
   *
   * @param name    is the name of this animal
   * @param rep     is the rate of reproduction for this animal
   * @param maxage  is the maximum age this animal can live to
   * @param afood   is the food that this animal eats
   */
  Animal(const std::string& name, double rep, int maxage, 
   const std::vector<std::string>& afood) :
    Organism(name, rep, maxage), food(afood)
  {
    
  }

  /**
   * gives this animal a special 
   * jump in the evolutionary food chain.
   *
   * @param forest is the forest in which this animal resides.
   */
  virtual void specialAdvance(Forest& forest);

  /**
   * this clones the animal.
   * ... a simple form of reproduction.
   */
  Organism* clone() const { return new Animal(*this); }


};

#endif
